package com.ruoyi.business.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.common.core.domain.dto.WsdPaymentRecordsDTO;
import com.ruoyi.common.core.domain.dto.WsdRefundManagementDTO;
import com.ruoyi.common.core.domain.entity.WsdRefundTransactions;
import com.ruoyi.common.core.domain.vo.OrderPeopleNumVO;
import com.ruoyi.common.core.domain.vo.RefundManagementVO;
import com.ruoyi.common.core.domain.vo.WsdRefundTransactionsVO;
import com.ruoyi.common.core.domain.vo.leaveNumberVO;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

/**
 * 退款流水表，记录所有退款相关的信息 Mapper 接口
 *
 * @author wwq
 * @since 2024-05-20
 */
public interface WsdRefundTransactionsMapper extends BaseMapper<WsdRefundTransactions> {

    /**
     * 查询退款流水，记录所有退款相关的信息列表
     *
     * @param wsdRefundTransactions 退款流水，记录所有退款相关的信息
     * @return 退款流水，记录所有退款相关的信息集合
     */
    public List<WsdRefundTransactions> selectWsdRefundTransactionsList(WsdRefundTransactions wsdRefundTransactions);

    List<WsdRefundTransactionsVO> listRefund( WsdPaymentRecordsDTO wsdPaymentRecordsDTO);

    List<Map<String, Object>> getTotalFeeByYear(@Param("currentYear") int currentYear,@Param("schoolId")   Long schoolId);

    List<Map<String, Object>> getTotalFeeByDateRange(@Param("startDate") String startDate, @Param("endDate") String endDate,@Param("schoolId") Long schoolId);

    List<Map<String, Object>> getTotalFeeByMonth(@Param("currentYear") int currentYear,@Param("schoolId")   Long schoolId );

    //当天退款统计
    leaveNumberVO leaveStatusReturn(@Param("schoolId") Long schoolId);

    List<RefundManagementVO> refundManagementList(WsdRefundManagementDTO wsdRefundManagementDTO);
    RefundManagementVO refundFoodById(Long id);

    WsdRefundTransactions selectWsdRefundByLeavesId(Long leavesId);
    List<WsdRefundTransactions> selectWsdRefundByLeavesIds(Long leavesId);
    OrderPeopleNumVO orderPeopleNum(WsdRefundManagementDTO wsdRefundManagementDTO);
    //统计退款金额
    BigDecimal refundedMoney(@Param("schoolId") Long schoolId, @Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);
    List<Map<String, Object>> getTotalFeeByTime(@Param("schoolId") Long schoolId, @Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);
}
